package com.heima.model.behavior.pojos;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Date;

/**
 * 文章不喜欢记录表
 * @Author huangjianfei
 * @Date 2024/11/09
 */
@Data
@TableName("ap_article_dislike")
public class ApArticleDislike {


    @TableId(value = "id",type = IdType.AUTO)
    private Long id;

    @TableField("article_id")
    private Long articleId;

    @TableField("user_id")
    private Integer userId;

    // 0 不喜欢 1 取消不喜欢
    @TableField("type")
    private Short type;

    @TableField("dislike_timestamp")
    private Date dislikeTimestamp;

    /*
    create table ap_article_dislike
(
    id             bigint auto_increment comment '主键ID'
        primary key,
    article_id     bigint unsigned  not null comment '文章ID',
    user_id        int unsigned     not null comment '用户id',
    type    tinyint unsigned null comment '0 不喜欢 1 取消不喜欢',
    dislike_timestamp datetime         null comment '不喜欢操作时间'
)
    comment '不喜欢记录表';

create index idx_article_user
    on ap_article_dislike (article_id, user_id);
     */
}
